package com.ttbj.product.owner.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.ttbj.api.dto.owner.OwnerDto;
import com.ttbj.api.exception.BusinessException;
import com.ttbj.api.owner.OwnerService;
import com.ttbj.constant.PlatFormErrorCode;
import com.ttbj.owner.dao.OwnerMapper;

@Service("ownerService")
public class OwnerServiceImpl implements OwnerService{
	
	@Autowired
	private OwnerMapper ownerMapper;

	
	
	@Override
	@Cacheable(value="findInfoUsedOrder",key="#ownerId")
	public OwnerDto findOwnerInfoById(Long ownerId) throws BusinessException {
		if (null == ownerId) {
			throw new BusinessException("参数有误", PlatFormErrorCode.PARAM_IS_NULL.code());
		}
		//通过id查询收发件人的信息
		OwnerDto ownerDto = this.ownerMapper.queryOwnerInfoById(ownerId);
		return ownerDto;
	}

}
